<style lang="less">
  @import '../styles/common.less';
  @import './style/avatar.less';
</style>
<style>

</style>
<template>
  <div class="avatar-div" @click="fun(show_user_id)">
    <img class="avatar-img" :src="show_user_img"/>
    <div class="avatar-name" v-text="show_user_name"></div>
  </div>
</template>

<script>
  import Cookies from 'js-cookie';
  import Util from '../../libs/util';
  import Utils from '../../libs/mod.utils';
  import String from '../../libs/mod.string';
  import Modal from '../../libs/mod.Modal';
  import Ckeditor from '../../libs/mod.ckeditor';
  export default {
    name: 'userAvatar',
    components: {},
    props: ['user_id', 'user_name', 'user_img', 'fun'],
    data () {
      return {
        uid: '',
        userInfo: {},
        showUserInfo: false,
        show_user_id: '',
        show_user_name: '',
        show_user_img: '',
        default_user_img: '/vendors/images/person.png',
      };
    },
    created: function () {
      var _this = this;
      _this.show_user_id = _this.user_id;
      _this.show_user_name = _this.user_name;
      _this.show_user_img = _this.user_img ? _this.user_img : _this.default_user_img;
    },
    watch: {
      user_id: function () {
        var _this = this;
        _this.show_user_id = _this.user_id;
        _this.show_user_name = _this.user_name;
        _this.show_user_img = _this.user_img ? _this.user_img : _this.default_user_img;
      }
    },
    mounted () {
      var _this = this;
    },
    methods: {}
  };
</script>
